<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8"
         contentType="text/html;charset=utf-8" %>
<%@ include file="/common/taglibs.jsp" %>
<head>
    <title>线下退款流水修改</title>
</head>
<body>
<div id="wrapper">
    <c:set var="left">bill</c:set>
    <%@ include file="/include/left/financial.jsp" %>

    <div id="page-wrapper" class="gray-bg">


        <div class="row wrapper border-bottom white-bg page-heading">
            <div class="col-lg-10">
                <h2>线下退款流水修改</h2>
                <ol class="breadcrumb">
                    <li>
                        <a href="${ctx}/bill/">流水管理</a>
                    </li>
                    <li>
                        <a>流水管理</a>
                    </li>
                    <li class="active">
                        <strong>线下退款流水修改</strong>
                    </li>
                </ol>
            </div>
        </div>

        <s:action name="bill!view" var="view" executeResult="false"/>


        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                            <s:form id="billFrom" action="bill!update.action" class="form-horizontal" method="post" namespace="">
                                <input type="hidden" name="redirect" value="/bill/"/>
                                <input type="hidden" name="id" value="${view.bill.id}"/>
                                <input type="hidden" name="bill.category" value="平台"/>
                                <input type="hidden" name="bill.type" value="平台线下退款"/>
                                <input type="hidden" name="bill.state" value="1"/>

                                <div class="form-group"><label class="col-sm-2 control-label">外部订单号</label>
                                    <div class="col-sm-6">
                                        <input type="text" name="bill.orderNo" value="${view.bill.orderNo}" class="form-control  validate[required]" placeholder="请输入外部订单号">
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">外部订单类型</label>
                                    <div class="col-sm-6">
                                        <select name="bill.orderType" class="input_md validate[required]">
                                                <option value="productOrder" <c:if test="${view.bill.orderType=='productOrder'}">selected</c:if> >普通订单</option>
                                                <option value="additionalOrder" <c:if test="${view.bill.orderType=='additionalOrder'}">selected</c:if> >补单</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group"><label class="col-sm-2 control-label">线下退款金额</label>
                                    <div class="col-sm-6">
                                        <input type="text" name="bill.outlay" class="form-control  validate[required,min[0],custom[number]]" value="${view.bill.outlay}" placeholder="请输入线下退款金额">
                                    </div>
                                </div>


                                <div class="form-group"><label class="col-sm-2 control-label">备注</label>
                                    <div class="col-sm-10">
                                        <textarea class="form-control" name="bill.remark" id="remark" placeholder="请输入相关退款消息">${view.bill.remark}</textarea>
                                    </div>
                                </div>

                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-2">
                                        <button class="btn btn-white" type="button"
                                                onclick="javascript:history.back(-1);">取消
                                        </button>
                                        <button class="btn btn-primary" id="submitButton" type="submit" data-loading-text="提交中..." >发布
                                        </button>
                                    </div>
                                </div>
                            </s:form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <%@ include file="/common/footer.jsp" %>


    </div>

</div>

<%@ include file="/common/scripts.jsp" %>
<%@ include file="/common/validate.jsp" %>
<%@ include file="/common/script/umeditor.jsp" %>
<%@ include file="/common/script/fileupload.jsp" %>


<script>
    $('#billFrom').validationEngine({
        promptPosition: 'topLeft',
        onValidationComplete:  function(form, status){//验证回调函数（阻断提交）
            if(status){//当所有验证通过后再执行
                submitForm();
            }
        }
    });


    function submitForm() {
        var _content = $('#remark').val();
        if (_content == null || _content == '') {
            layer.msg('请输入有效备注内容');
        } else {
            $('#submitButton').button('loading')
            $('#billFrom').submit();
        }


    }
</script>

</body>

